Skip to content

Remove fancy quotes#433

Merged
lawrence-forooghian merged 1 commit intomainfrom
remove-fancy-quotes
Oct 17, 2025
Merged

Remove fancy quotes#433
lawrence-forooghian merged 1 commit intomainfrom
remove-fancy-quotes

Conversation

@lawrence-forooghian
Copy link
Copy Markdown
Collaborator

@lawrence-forooghian lawrence-forooghian commented Oct 17, 2025

Note: This PR is based on top of #432.

Due to LLM limitations, LLM coding assistants frequently steamroller these and convert them into straight quotes. We have two choices: fight them at every step and keep reverting their changes, or just give up on fancy quotes. I think that realistically, we wouldn't do the first one, and would instead just keep introducing noise into diffs.

Summary by CodeRabbit

  • Style

    • Standardized punctuation and typography across codebase comments and documentation (replaced typographic apostrophes with ASCII equivalents).
  • Documentation

    • Corrected minor spelling errors in documentation comments (e.g., "received" and "receiver's").
    • Normalized quote formatting and possessive punctuation in inline code references and examples.

Due to LLM limitations, LLM coding assistants frequently steamroller
these and convert them into straight quotes. We have two choices: fight
them at every step and keep reverting their changes, or just give up on
fancy quotes. I think that realistically, we wouldn't do the first one,
and would instead just keep introducing noise into diffs.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 17, 2025

Walkthrough

This PR standardizes typographic characters across the codebase by replacing typographic apostrophes, quotation marks, and smart quotes with ASCII equivalents throughout documentation, comments, and string literals. No functional code, control flow, or public API changes are introduced.

Changes

Cohort / File(s) Summary
Root Documentation
CONTRIBUTING.md
Replaced typographic punctuation with ASCII equivalents in prose and comments.
Core Library — Comments & Documentation
Sources/AblyChat/ChatClient.swift, Sources/AblyChat/Connection.swift, Sources/AblyChat/ErrorInfo.swift, Sources/AblyChat/Errors.swift, Sources/AblyChat/JSONValue.swift, Sources/AblyChat/Logging.swift, Sources/AblyChat/Message.swift, Sources/AblyChat/RoomLifecycleManager.swift, Sources/AblyChat/Rooms.swift, Sources/AblyChat/SimpleClock.swift, Sources/AblyChat/SubscriptionAsyncSequence.swift, Sources/AblyChat/SubscriptionStorage.swift, Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift
Standardized apostrophes and quotation marks from typographic to ASCII format in public documentation and internal comments. Fixed minor typos (e.g., "recieved" → "received", "reciever's" → "receiver's").
Example Mocks
Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift
Replaced typographic apostrophes with ASCII equivalents in comment text.
Build Tool — Source Files
Sources/BuildTool/BuildTool.swift, Sources/BuildTool/DestinationFetcher.swift, Sources/BuildTool/ProcessRunner.swift
Normalized punctuation in comments, documentation strings, and error messages from typographic to ASCII format.
Test Files & Helpers
Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift, Tests/AblyChatTests/DefaultRoomOccupancyTests.swift, Tests/AblyChatTests/DefaultRoomTests.swift, Tests/AblyChatTests/DefaultRoomsTests.swift, Tests/AblyChatTests/JSONValueTests.swift, Tests/AblyChatTests/Mocks/MockRealtime.swift, Tests/AblyChatTests/Helpers/SynchronizedAccess.swift, Tests/AblyChatTests/Helpers/TestLogger.swift
Replaced typographic apostrophes and quotation marks with ASCII equivalents in test comments and documentation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a single, highly repetitive pattern (typographic → ASCII punctuation normalization) across all affected files. While the volume of files is substantial, the uniformity of modifications and lack of behavioral changes minimize complexity. Review effort is primarily to confirm consistency of normalization across the codebase.

Poem

🐰 Our apostrophes were curly, our quotes were fancy and grand,
But now they're straight and ASCII, neat across the land!
No logic bent or code did break, just prettied up the prose—
Typography takes a bow, as clean punctuation glows!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Remove fancy quotes" is fully related to the main change in the changeset. The raw summary confirms that across all 25 modified files, the changes consistently replace typographic (curly) apostrophes and quotation marks with straight ASCII equivalents in comments and documentation. The title is concise, clear, and specific—it accurately captures the primary change that a teammate reviewing history would understand. The PR objectives further confirm this is the intended change, as the author explicitly decided to remove fancy quotes to avoid ongoing diff noise from LLM tools.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-fancy-quotes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/AblyChat/Rooms.swift (1)

281-283: Typo in log message: “Recieved” → “Received”.

Minor text polish for logs.

Apply:

-                logger.log(message: "Recieved request to fail room creation with error \(error)", level: .debug)
+                logger.log(message: "Received request to fail room creation with error \(error)", level: .debug)
🧹 Nitpick comments (2)
CONTRIBUTING.md (1)

107-107: Optional: clarify with underscore “testsOnly_”.

To avoid ambiguity, consider “APIs marked testsOnly_”.

As per coding guidelines

Sources/AblyChat/Logging.swift (1)

113-114: Doc symbol likely incorrect: “DefaultInternalLogHandler” doesn’t exist.

Replace with “DefaultInternalLogger” to match the type name used above.

-/// The logging backend used by ``DefaultInternalLogHandler`` if the user has not provided their own. Uses Swift's `Logger` type for logging.
+/// The logging backend used by ``DefaultInternalLogger`` if the user has not provided their own. Uses Swift's `Logger` type for logging.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c066e1b and d9b38f6.

📒 Files selected for processing (26)
  • CONTRIBUTING.md (4 hunks)
  • Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift (2 hunks)
  • Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift (1 hunks)
  • Sources/AblyChat/ChatClient.swift (1 hunks)
  • Sources/AblyChat/Connection.swift (1 hunks)
  • Sources/AblyChat/ErrorInfo.swift (1 hunks)
  • Sources/AblyChat/Errors.swift (1 hunks)
  • Sources/AblyChat/JSONValue.swift (5 hunks)
  • Sources/AblyChat/Logging.swift (3 hunks)
  • Sources/AblyChat/Message.swift (1 hunks)
  • Sources/AblyChat/RoomLifecycleManager.swift (8 hunks)
  • Sources/AblyChat/Rooms.swift (3 hunks)
  • Sources/AblyChat/SimpleClock.swift (1 hunks)
  • Sources/AblyChat/SubscriptionAsyncSequence.swift (2 hunks)
  • Sources/AblyChat/SubscriptionStorage.swift (2 hunks)
  • Sources/BuildTool/BuildTool.swift (13 hunks)
  • Sources/BuildTool/DestinationFetcher.swift (1 hunks)
  • Sources/BuildTool/ProcessRunner.swift (1 hunks)
  • Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift (12 hunks)
  • Tests/AblyChatTests/DefaultRoomOccupancyTests.swift (2 hunks)
  • Tests/AblyChatTests/DefaultRoomTests.swift (2 hunks)
  • Tests/AblyChatTests/DefaultRoomsTests.swift (10 hunks)
  • Tests/AblyChatTests/Helpers/SynchronizedAccess.swift (1 hunks)
  • Tests/AblyChatTests/Helpers/TestLogger.swift (1 hunks)
  • Tests/AblyChatTests/JSONValueTests.swift (1 hunks)
  • Tests/AblyChatTests/Mocks/MockRealtime.swift (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
Sources/**/*.swift

📄 CodeRabbit inference engine (CLAUDE.md)

Sources/**/*.swift: Prefer protocol-based design; expose SDK functionality via protocols and prefer opaque return types (some Protocol) over existential any Protocol
Isolate all mutable state to the main actor; mark stateful objects with @mainactor
Public API should use typed throws with ARTErrorInfo
Use InternalError internally and convert to ARTErrorInfo at public API boundaries
Test-only APIs in the library must be prefixed testsOnly_ and wrapped in #if DEBUG
Reference Chat SDK spec items in implementation comments (e.g., // @SPEC CHA-RL3g)
For public structs exposed by the API, provide an explicit public memberwise initializer
When using AsyncSequence operators in @mainactor contexts, mark operator closures as @sendable
For Task, CheckedContinuation, and AsyncThrowingStream (which don’t support typed errors), use Result and call .get() to bridge typed errors
Avoid Dictionary.mapValues for typed-throwing transformations; use ablyChat_mapValuesWithTypedThrow
When the compiler struggles with typed throws, explicitly annotate do throws(InternalError) blocks
Specify error types in closures, e.g., try items.map { jsonValue throws(InternalError) in … }

Files:

  • Sources/AblyChat/SubscriptionStorage.swift
  • Sources/BuildTool/DestinationFetcher.swift
  • Sources/AblyChat/Logging.swift
  • Sources/AblyChat/JSONValue.swift
  • Sources/BuildTool/ProcessRunner.swift
  • Sources/AblyChat/Connection.swift
  • Sources/AblyChat/SubscriptionAsyncSequence.swift
  • Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift
  • Sources/AblyChat/RoomLifecycleManager.swift
  • Sources/AblyChat/Rooms.swift
  • Sources/AblyChat/Message.swift
  • Sources/AblyChat/ErrorInfo.swift
  • Sources/AblyChat/SimpleClock.swift
  • Sources/AblyChat/Errors.swift
  • Sources/AblyChat/ChatClient.swift
  • Sources/BuildTool/BuildTool.swift
Tests/AblyChatTests/**/*.swift

📄 CodeRabbit inference engine (CLAUDE.md)

Tests/AblyChatTests/**/*.swift: Place all tests under Tests/AblyChatTests
Use test attribution tags: @SPEC, @specOneOf(m/n), @specPartial, @specUntested, @specNotApplicable with appropriate spec IDs and explanations
For Swift Testing #expect(throws:) with typed errors, move typed-throw code into a separate non-typed-throw function (until Xcode 16.3+)

Files:

  • Tests/AblyChatTests/Mocks/MockRealtime.swift
  • Tests/AblyChatTests/Helpers/SynchronizedAccess.swift
  • Tests/AblyChatTests/DefaultRoomTests.swift
  • Tests/AblyChatTests/DefaultRoomOccupancyTests.swift
  • Tests/AblyChatTests/DefaultRoomsTests.swift
  • Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift
  • Tests/AblyChatTests/JSONValueTests.swift
  • Tests/AblyChatTests/Helpers/TestLogger.swift
Tests/AblyChatTests/Mocks/**/*.swift

📄 CodeRabbit inference engine (CLAUDE.md)

Place mock implementations under Tests/AblyChatTests/Mocks

Files:

  • Tests/AblyChatTests/Mocks/MockRealtime.swift
🧬 Code graph analysis (1)
Sources/AblyChat/Logging.swift (5)
Tests/AblyChatTests/Helpers/TestLogger.swift (1)
  • log (9-15)
Tests/AblyChatTests/IntegrationTests.swift (2)
  • log (23-25)
  • log (36-38)
Tests/AblyChatTests/Mocks/MockLogHandler.swift (1)
  • log (6-8)
Tests/AblyChatTests/DefaultInternalLoggerTests.swift (1)
  • log (12-29)
Tests/AblyChatTests/Mocks/MockInternalLogger.swift (1)
  • log (6-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Example app, macOS (Xcode 26.0)
  • GitHub Check: SPM (Xcode 26.0)
  • GitHub Check: Example app, tvOS (Xcode 26.0)
  • GitHub Check: Xcode, tvOS (Xcode 26.0)
  • GitHub Check: SPM, release configuration (Xcode 26.0)
  • GitHub Check: Example app, iOS (Xcode 26.0)
  • GitHub Check: Xcode, macOS (Xcode 26.0)
  • GitHub Check: Xcode, iOS (Xcode 26.0)
  • GitHub Check: Xcode, release configuration, tvOS (Xcode 26.0)
  • GitHub Check: Xcode, release configuration, iOS (Xcode 26.0)
  • GitHub Check: Xcode, release configuration, macOS (Xcode 26.0)
  • GitHub Check: lint
🔇 Additional comments (57)
Tests/AblyChatTests/Helpers/TestLogger.swift (1)

4-4: LGTM: wording/quote normalization only

No functional changes.

Sources/AblyChat/SubscriptionStorage.swift (2)

36-36: LGTM: doc comment typo fixed

“receiver's” spelling correction; code untouched.


77-77: LGTM: doc comment typo fixed

Consistent with above; no behavior impact.

Tests/AblyChatTests/DefaultRoomOccupancyTests.swift (2)

55-55: LGTM: test comment normalization

No effect on tests or spec coverage.


137-137: LGTM: test comment normalization

No behavioral changes.

Tests/AblyChatTests/Mocks/MockRealtime.swift (1)

5-5: LGTM: doc comment normalization

Text-only change; safe.

Sources/BuildTool/ProcessRunner.swift (1)

7-7: LGTM: comment-only text normalization

This is a straightforward comment edit with no behavioral impact. The repository-wide scan for smart quotes confirms no problematic occurrences in code comments.

Sources/AblyChat/SimpleClock.swift (1)

5-5: Doc punctuation normalization acknowledged.

Purely textual; safe.

Tests/AblyChatTests/Helpers/SynchronizedAccess.swift (1)

3-3: Test helper comments: standardized quotes.

No behavior change; good to go.

Also applies to: 5-5

Tests/AblyChatTests/DefaultRoomTests.swift (1)

212-213: Test comments standardized; intent preserved.

Non-functional; safe.

Also applies to: 233-233

Sources/AblyChat/ChatClient.swift (1)

160-160: Docs: ASCII apostrophe replacement.

No code changes; approve.

Sources/AblyChat/Connection.swift (1)

69-69: ---

Comment-only change; standardization confirmed.

Verification confirms no curly quotes remain in Swift sources. The change is sound with no functional impact.

Optional: enforce quote style in SwiftLint to prevent regressions by adding to .swiftlint.yml:

custom_rules:
  disallow_curly_quotes:
    name: "Disallow Curly Quotes"
    regex: "[\u2018\u2019\u201C\u201D]"
    message: "Use straight ASCII quotes (' and \")."
    severity: error
Tests/AblyChatTests/JSONValueTests.swift (1)

104-104: LGTM — comment normalization only.

Sources/AblyChat/ErrorInfo.swift (1)

199-199: LGTM — documentation tweak, no behavior change.

Sources/AblyChat/SubscriptionAsyncSequence.swift (1)

7-7: LGTM — comment-only normalization.

Also applies to: 9-9, 20-20

CONTRIBUTING.md (2)

39-40: LGTM — prose only; quotes standardized.


138-138: LGTM — text normalization; no procedural changes.

Also applies to: 142-142

Example/AblyChatExample/Mocks/MockSubscriptionStorage.swift (1)

4-4: LGTM: comment-only quote normalization.

No behavioral changes; safe.

Also applies to: 62-62

Sources/AblyChat/Rooms.swift (2)

88-88: LGTM: documentation punctuation normalized.

Text-only edits; API and behavior unchanged.

Also applies to: 220-220, 359-359


88-88: Review comment is incorrect; line 88 contains ASCII quotes, not curly quotes.

The regex search for [''""—…] found no matches in Sources/AblyChat/Rooms.swift. The visible snippet shows line 88 with ASCII straight quotes ("room map"), confirmed by cat -A output. The suggestion to add a CI check is based on a false premise.

Likely an incorrect or invalid review comment.

Sources/AblyChat/Errors.swift (1)

140-140: LGTM: docstring apostrophe normalized.

No code or API impact.

Sources/AblyChat/Logging.swift (1)

52-52: LGTM: doc comments normalized.

Text-only; no behavior change.

Also applies to: 71-71, 114-114

Sources/BuildTool/DestinationFetcher.swift (1)

14-14: No action required; code verified as correct.

The error message at line 14 correctly uses an ASCII apostrophe in "Couldn't find a simulator". Verification found no tests asserting this exact message, so there are no test updates to make.

Sources/AblyChat/Message.swift (2)

224-229: Comment normalization only; LGTM.
Spec note preserved; no logic change.


224-229: The reviewed code contains no smart punctuation—disregard this review comment.

The verification confirms that Sources/AblyChat/Message.swift lines 224-229 contain only standard ASCII characters, with no smart quotes, em dashes, or other Unicode punctuation. The code snippet shown in the review is clean. While the codebase does have smart punctuation elsewhere (confirmed in documentation and test files), the specific code under review is not affected and requires no changes.

Likely an incorrect or invalid review comment.

Tests/AblyChatTests/DefaultRoomLifecycleManagerTests.swift (10)

10-16: Docstring punctuation normalized; LGTM.
No code behavior changes.


87-89: Clarified “no‑op” wording; LGTM.
Expectation unchanged.


156-160: Comment clarity tweak; LGTM.
No test semantics altered.


190-192: Post-test note punctuation only; LGTM.


247-251: Bullet wording normalized; LGTM.
Assertions untouched.


272-274: “no‑op” phrasing normalized; LGTM.


358-361: Dash/quotes normalized; LGTM.
No timing/await logic changes.


391-393: Post-test note normalized; LGTM.


536-540: Comment punctuation only; LGTM.


572-574: Post-test note normalized; LGTM.

Tests/AblyChatTests/DefaultRoomsTests.swift (10)

10-18: Docstring normalization; LGTM.
No behavioral impact.


110-113: Spec comment wording normalized; LGTM.


135-141: “Given” explanatory comments normalized; LGTM.


183-186: Spec-language comment normalization; LGTM.


206-213: “Given”/waiting explanation punctuation; LGTM.


283-286: “no‑op” phrasing normalized; LGTM.


324-327: Spec “future” wording normalized; LGTM.


353-356: Reference to spec “future” normalized; LGTM.


364-374: Error expectation comment clarified; LGTM.


380-383: Spec reuse wording normalized; LGTM.

Sources/AblyChat/JSONValue.swift (5)

9-31: Top‑level docstring normalized; LGTM.
Examples and notes unchanged.


151-153: Bridging bullets reworded; LGTM.
No API change.


178-181: Extras doc normalized; LGTM.
Assumptions unchanged.


195-198: Usage bullets normalized; LGTM.


221-224: Dictionary bridging bullets normalized; LGTM.

Sources/AblyChat/RoomLifecycleManager.swift (6)

299-301: Doc note punctuation normalized; LGTM.


346-351: Operation docs normalized (contractions/possessives); LGTM.


381-389: ATTACH operation doc header normalized; LGTM.


444-452: DETACH operation doc header normalized; LGTM.


509-517: RELEASE operation doc header normalized; LGTM.


587-590: Inline explanatory comments normalized; LGTM.

Sources/BuildTool/BuildTool.swift (1)

117-117: All quote replacements are cosmetic and complete—no functional impact.

The changes systematically replace typographic quotes (curly/smart quotes) with ASCII equivalents across documentation comments and string literals throughout the file. No functional code, control flow, declarations, or public API signatures were modified. This aligns cleanly with the PR objectives to standardize typographic characters and avoid ongoing diff noise from LLM conversions.

Also applies to: 153-153, 198-198, 223-223, 225-225, 302-302, 325-325, 326-326, 437-437, 613-613, 614-614, 615-615, 616-616, 617-617, 618-618, 678-678, 758-758, 763-763, 772-772, 800-800, 818-818

Comment thread CONTRIBUTING.md
Comment thread Sources/AblyChat/AblyCocoaExtensions/InternalAblyCocoaTypes.swift
Comment thread Sources/AblyChat/Logging.swift
Base automatically changed from 32-throw-our-own-ErrorInfo to main October 17, 2025 13:01
Copy link
Copy Markdown
Collaborator

@maratal maratal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought these were fancy and prepared to be upset, lol

@lawrence-forooghian lawrence-forooghian merged commit da9c883 into main Oct 17, 2025
17 checks passed
@lawrence-forooghian lawrence-forooghian deleted the remove-fancy-quotes branch October 17, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants